package com.example.victory.swagger.model;

import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;

/**
 * Otc持仓信息
 */
@ApiModel(description = "Otc持仓信息")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2021-04-26T10:50:39.083+08:00")

public class OtcPosition   {
  @JsonProperty("profitLoss")
  private Double profitLoss = null;

  @JsonProperty("code")
  private String code = null;

  @JsonProperty("name")
  private String name = null;

  @JsonProperty("details")
  @Valid
  private List<OtcPositionDetail> details = null;

  public OtcPosition profitLoss(Double profitLoss) {
    this.profitLoss = profitLoss;
    return this;
  }

  /**
   * 累计收益
   * @return profitLoss
  **/
  @ApiModelProperty(example = "11.05", value = "累计收益")


  public Double getProfitLoss() {
    return profitLoss;
  }

  public void setProfitLoss(Double profitLoss) {
    this.profitLoss = profitLoss;
  }

  public OtcPosition code(String code) {
    this.code = code;
    return this;
  }

  /**
   * 编号
   * @return code
  **/
  @ApiModelProperty(example = "1", value = "编号")


  public String getCode() {
    return code;
  }

  public void setCode(String code) {
    this.code = code;
  }

  public OtcPosition name(String name) {
    this.name = name;
    return this;
  }

  /**
   * 名称
   * @return name
  **/
  @ApiModelProperty(example = "景秀300", value = "名称")


  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public OtcPosition details(List<OtcPositionDetail> details) {
    this.details = details;
    return this;
  }

  public OtcPosition addDetailsItem(OtcPositionDetail detailsItem) {
    if (this.details == null) {
      this.details = new ArrayList<OtcPositionDetail>();
    }
    this.details.add(detailsItem);
    return this;
  }

  /**
   * 附加信息
   * @return details
  **/
  @ApiModelProperty(value = "附加信息")

  @Valid

  public List<OtcPositionDetail> getDetails() {
    return details;
  }

  public void setDetails(List<OtcPositionDetail> details) {
    this.details = details;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    OtcPosition otcPosition = (OtcPosition) o;
    return Objects.equals(this.profitLoss, otcPosition.profitLoss) &&
        Objects.equals(this.code, otcPosition.code) &&
        Objects.equals(this.name, otcPosition.name) &&
        Objects.equals(this.details, otcPosition.details);
  }

  @Override
  public int hashCode() {
    return Objects.hash(profitLoss, code, name, details);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class OtcPosition {\n");
    
    sb.append("    profitLoss: ").append(toIndentedString(profitLoss)).append("\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    details: ").append(toIndentedString(details)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}

